<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:s="http://www.springframework.org/security/tags">
	<h:form>
		<p:panel>
			<f:facet name="header">
				<h:outputText value="#{msg['common.lab']}"/>
			</f:facet>
			<h:panelGrid columns="3" columnClasses="formInputTitle,formInput">
				<p:outputLabel for="name" value="#{msg['lab.name']}"/>
				<p:inputText id="name" value="#{expertLabBean.item.name}"/>
				<h:message for="name" showDetail="false"/>
			</h:panelGrid>
			<p:editor id="text" value="#{expertLabBean.item.text}" width="600"/>
			<p:dataTable width="100%" id="variantsList" rows="20"
				rendered="#{expertLabBean.item.id != -1}"
				columnClasses="col" value="#{expertVariantBean.all}" var="variant">
				<p:column style="width:1px">
					<f:facet name="header">
						<h:commandLink action="#{expertVariantBean.add}">
							<f:setPropertyActionListener value="#{variant}"
								target="#{expertVariantBean.item}"/>
							<h:graphicImage value="/images/add.png"/>
						</h:commandLink>
					</f:facet>
					<h:commandLink action="#{expertVariantBean.edit}">
						<f:setPropertyActionListener value="#{variant}"
							target="#{expertVariantBean.item}"/>
						<h:graphicImage value="/images/edit.png"/>
					</h:commandLink>
				</p:column>
				<p:column style="width: 1px">
					<h:commandLink action="#{expertVariantBean.delete}"
						update="variantsList">
						<f:setPropertyActionListener value="#{variant}"
							target="#{expertVariantBean.item}"/>
						<h:graphicImage value="/images/delete.png"/>
					</h:commandLink>
				</p:column>
				<p:column>
					<f:facet name="header">
						<h:outputText styleClass="headerText"
							value="#{msg['lab.variant']}"/>
					</f:facet>
					<h:outputText id="name" value="#{variant.text}" escape="false"/>
				</p:column>
			</p:dataTable>
			<h:panelGrid columns="2">
				<h:commandButton action="#{expertLabBean.save}"
					value="#{msg['action.save']}"
					styleClass="inputButton">
					<f:setPropertyActionListener
						value="#{expertLabBean.item}"
						target="#{expertLabBean.item}"/>
				</h:commandButton>
				<h:commandButton action="#{expertLabBean.cancel}"
					value="#{msg['action.cancel']}" styleClass="inputButton"/>
			</h:panelGrid>
		</p:panel>
	</h:form>
</ui:composition>
